package com.gusto.engine.semsim.neighborhood.storedistance;

import java.util.List;

import com.gusto.engine.semsim.Neighbor;

/**
 * <p>Defines the interface for persisting similarities into.</p>
 * 
 * @author amokrane.belloui@gmail.com
 *
 */
public interface SimilarityPersistenceDAO {
	
	/**
	 * Get a persisted similarity
	 * @param context
	 * @param resource1
	 * @param resource2
	 * @return
	 */
	public Double getDistance(String context, String resource1, String resource2);
	
	/**
	 * Persist a similarity
	 * @param context
	 * @param resource1
	 * @param resource2
	 * @param similarity
	 */
	public void updateDistance(String context, String resource1, String resource2, Double similarity);
	
	/**
	 * Clean all similarities in a context
	 * @param context
	 */
	public void cleanDistances(String context);
	
	/**
	 * get the neighborhood of a resource
	 * @param context
	 * @param resource
	 * @param minDistance
	 * @param maxNeighbors
	 * @return
	 */
	public List<Neighbor> getNeighborhood(String context, String resource, Double minDistance, Integer maxNeighbors);
	
}
